{{ $micromodal := resources.Get "js/micromodal.min.js" | resources.Fingerprint }}
<script defer src="{{ $micromodal.RelPermalink }}"></script>
{{ $clipboard := resources.Get "js/clipboard.min.js" | resources.Fingerprint }}
<script defer src="{{ $clipboard.RelPermalink }}"></script>

<script>
  document.addEventListener('DOMContentLoaded', function () {
    // modal
    MicroModal.init({
      disableScroll: true,
      disableFocus: true,
      awaitOpenAnimation: false,
      awaitCloseAnimation: false,
      debugMode: false,
      onClose: function(modal) {
        if (clipboard) {
          clipboard = null;
        }
      },
    });

    var citeBtn = document.getElementById('citeBtn');
    citeBtn.addEventListener('click', function () {
      MicroModal.show('modal');
    });

    // clipboard
    var clipboard = new ClipboardJS('#copyBtn');
  });
</script>